#!/usr/bin/env python
from flask import Flask, g
from happypress.views.admin import admin
from happypress.views.frontend import frontend
from happypress.models import db

app = Flask(__name__)

# config
app.config.from_object('happypress.config')

# register module
app.register_module(frontend)
app.register_module(admin)

@app.after_request
def shutdown_session(response):
    db.session.remove()
    return response